<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>axios简化</title>
		<script src="../js/axios.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<script>
			axios.defaults.baseURL = "http://localhost:8090/vue"
			// axios查询调用
			/**
			 * 麻烦写法
			 * axios.get("/findAll").then(
		     * promise => {
			 *		console.log(promise.data)
			 *		}
			 *)
			 */
			
			/**
			 * 简化:async-await关键字
			 * async  标识函数
			 * await  标识请求
			 */
			//简化后
			async function findAll(){
				//let {属性:别名}  例:let {data : result }
				let {data : result} = await axios.get("/find All")
				console.log(result)
			}
			
			findAll()
		</script>
	</body>
</html>
